#region Summary

// 
// Owner : JackieHan 
// 
// Solution : UpdateSystem 
// 
// Project : Skomart.Update.Config 
// 
// File : UpdateConfigItem.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 更新配置项
// 
// History : 
//			2010-08-02 11:50:34	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using System.Xml;
using Jackie.Utility;

#endregion

namespace Jackie.Update.Config
{
    /// <summary> 
    /// 更新配置项
    /// </summary>
    [Serializable]
    public class UpdateFileInfo
    {
        /// <summary>
        /// 路径
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 操作类型
        /// </summary>
        public OperateType OperateType { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        public long Length { get; set; }

        public UpdateFileInfo(XmlNode fileNode)
        {
            Path = fileNode.Attributes["path"].Value;
            OperateType = (OperateType)Enum.Parse(typeof(OperateType),
                           fileNode.Attributes["operateType"].Value);
            Length = JackieConvertor.ToLongThrowException(fileNode.Attributes["fileLength"].Value);
        }
    }
}